package pwd.allen.easyes.entity;

import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexId;
import cn.easyes.annotation.IndexName;
import cn.easyes.annotation.rely.FieldType;
import cn.easyes.annotation.rely.IdType;
import lombok.Data;

import java.util.List;

/**
 * {
 *     "mappings": {
 *         "properties": {
 *             "desc": {
 *                 "type": "keyword"
 *             },
 *             "easyEsDocs": {
 *                 "type": "nested",
 *                 "properties": {
 *                     "aFloat": {
 *                         "type": "text"
 *                     },
 *                     "aInt": {
 *                         "type": "text"
 *                     },
 *                     "date": {
 *                         "type": "text"
 *                     },
 *                     "geoPoint": {
 *                         "type": "geo_point"
 *                     },
 *                     "id": {
 *                         "type": "text"
 *                     },
 *                     "keyword": {
 *                         "type": "keyword"
 *                     },
 *                     "textKeyword": {
 *                         "type": "keyword"
 *                     },
 *                     "textMaxWord": {
 *                         "type": "text",
 *                         "analyzer": "ik_max_word"
 *                     },
 *                     "textSmart": {
 *                         "type": "text",
 *                         "analyzer": "ik_smart"
 *                     },
 *                     "textStand": {
 *                         "type": "text"
 *                     }
 *                 }
 *             }
 *         }
 *     }
 * }
 *
 * @author pwdan
 * @create 2024-12-02 15:18
 **/
@IndexName(value = "easy_es_nest_doc")
@Data
public class NestDoc {

    @IndexId(type = IdType.CUSTOMIZE)
    private String id;
    private String desc;
    @IndexField(fieldType = FieldType.NESTED, nestedClass = EasyEsDoc.class)
    private List<EasyEsDoc> easyEsDocs;
}
